<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title>项目管理系统</title>
	<link rel="stylesheet" href="static/css/bootstrap.min.css" />
	<style type="text/css">
		body{
			background-image:url(static/img/bg.png);
		}
	</style>
</head>
<body>
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a class="brand" href="#">Kaishengit PMS</a>
			</div>
		</div>
	</div>
	
	<div class="container">
		<div class="row">
			<div class="span3">
				<div style="padding:8px 0;margin-top:60px">
					<ul class="nav nav-list">
					  <li class="nav-header" style="font-size:14px">${sessionScope.userProject.project.name }</li>
					  <li class="divider"></li>
					  <li><a href="project.jspx"><i class="icon-home"></i>最新动态</a></li>
					  <li>
						<a href="goal.jspx"><i class="icon-flag"></i>目标</a>
					  </li>
					  <li class="active"><a href="document.jspx"><i class="icon-white icon-folder-open"></i>资料库</a></li>
					  <li><a href="files.jspx"><i class="icon-file"></i>文件共享</a></li>
					  <li><a href="contact.jspx"><i class="icon-user"></i>联系人</a></li>
					  <li><a href="idea.jspx"><i class="icon-fire"></i>想法</a></li>
					  <li><a href="#"><i class="icon-warning-sign"></i>Bug</a></li>
					  <li><a href="set.jspx"><i class="icon-cog"></i>项目设置</a></li>
					</ul>
				</div>
			
			</div>
			<div class="span9" style="margin-top:80px">
				<ul class="breadcrumb" style="margin-bottom:0px;border-bottom:none">
					<li class="active">
						<a href="#"><i class="icon-folder-open"></i>资料</a>
					</li>
					<li class="active" style="float:right">
						<a href="document.jspx?m=add"><i class="icon-plus"></i>分享新资料</a>
					</li>					
				</ul>
				<div style="border:1px solid #ddd;padding:15px">
					<c:if test="${ empty page.result }">还没有任何资料，快快<a href="document.jspx?m=add">分享</a>吧！</c:if>
					<c:forEach items="${page.result }" var="document">
						<blockquote>
						<h4><a href="document.jspx?id=${document.id }">${document.title }</a></h4><hr>
						<div style="height:80px;overflow:hidden">
							<pre style="background-image:url(static/img/bg.png);border:none;margin:0px">${document.content }</pre>
						</div>…………
						
						<small>${document.user.name }发布于${document.createtime }</small>
						<c:choose>
							<c:when test="${document.user.id == sessionScope.userProject.user.id }">
								<a href="document.jspx?m=edit&&id=${document.id }"><i class="icon-pencil"></i></a>
							</c:when>
						</c:choose>
						<c:choose>
							<c:when test="${document.user.id eq sessionScope.userProject.user.id }">
								<a href="document.jspx?m=del&&id=${document.id }"><i class="icon-trash"></i></a>
							</c:when>
						</c:choose>
						</blockquote>
					</c:forEach>
					
					<div class="pagination pagination-right">
						 <ul>
							<c:forEach begin="1" end="${page.totalPages }" varStatus="stat">
								<li><a href="document.jspx?p=${stat.count }">${stat.count }</a></li>
							</c:forEach>
						</ul>
					</div>					
				</div>
			
			</div>
		</div>
	
	</div>
</body>
</html>